version 8.2
capture clear
capture log close
set more off
set mem 1000m
set mat 800

set scheme s2mono

****Figure B1:
use "Rule of law.dta"
ren ruleoflawestimaterlest ruleoflaw
label variable ruleoflaw "Rule of Law"
sum ruleoflaw
*ruleoflaw is standardized
sort countryname time
save "Rule of law_clean.dta", replace

clear

use "GDP per capita_clean.dta" 
sort countryname time
merge countryname time using "Rule of law_clean.dta"
codebook _merge
drop _merge

sort countryname time
merge countryname time using "GDP per employed_clean.dta"
codebook _merge
drop _merge

graph twoway (scatter  gdpperpersonemployedconstant2011 ruleoflaw, mlabel(countrycode) mlabposition(0) msymbol(i)  mlabsize(1.5)) (lfit  gdpperpersonemployedconstant2011 ruleoflaw) if time==2014, legend(off) xtitle(Rule of Law Index) ytitle(GDP per person employed (constant 2011 USD PPP))
graph export "Figure B1 Correlation Rule of Law GDP per worker.png", replace

